<template>
  <div class="app-container">
    
     <div class="hello">  
        <ul>  
    <form @submit.prevent="onSubmit">  
                <input type="text" name="username" v-model="result.name">  
                 
                <input type="submit" value="提交">  
            </form>  
             </ul>  
    </div> 
    <input type='button' value="切换" v-on:click='toggle'>
    <input type="text" v-model="title" v-if="isShow"/>
  </div>
  
</template>

<script>
import { addUser, ess } from '@/modules/user/model/user'

export default {

  data() {
    return {
      isShow: false,
      title: '',
      result: {
        name: ''

      }
    }
  },
  methods: {
    onSubmit() {
      addUser(this.result).then(response => {
        alert('提交成功')
      })
    },
    toggle() {
      this.title = 'wwe'
      this.isShow = true
    }
  },
  mounted: function() {
                // 这里是vue初始化完成后执行的函数
    this.$nextTick(function() {
                   // 应该是这里执行关闭动画
      ess()
    })
  }
}
</script>
